package work.zhengyun.demo;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import work.zhengyun.demo.netty.server.NettyServer;

import java.net.InetSocketAddress;

@SpringBootApplication
@MapperScan("work.zhengyun.demo.dao")
public class DemoApplication implements CommandLineRunner {
    @Autowired
    private NettyServer nettyServer;
    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        InetSocketAddress address = new InetSocketAddress("127.0.0.1",8888);
        nettyServer.start(address);
    }
}
